package com.atguigu.yygh.vo.user;
//饿汉模式立即加载
public class Singleton1 {
    //私有的构造方
    private Singleton1(){

    }
    //初始值为实例对象
    private static Singleton1 single  = new Singleton1();
    //静态工厂方法,返回单例对象
    public Singleton1 getInstance(){
        return single;
    }

    public static void main(String[] args) {
        System.out.println("初始化");
        Singleton1 instance = single .getInstance();
    }
}
